import request from '@/utils/request'

export function getEmployess() {
  return request({
    url: '/sys/user/simple'
  })
}

/**
 * 获取员工列表
 * @param {*} page
 * @param {*} size
 * @returns
 */
export function getEmployessList(page, size) {
  return request({
    url: '/sys/user',
    params: { page, size }
  })
}
/**
 * 删除员工
 * @param {*} id 员工id
 * @returns
 */
export function delEmployess(id) {
  return request({
    url: `/sys/user/${id}`,
    method: 'delete'
  })
}

/**
 * 新增员工
 * @param {*} data
 * @returns
 */
export function addEmployess(data) {
  return request({
    url: `/sys/user`,
    method: 'post',
    data
  })
}

/**
 * 批量导入员工
 * @param {*} data
 * @returns
 */
export function addEmployessBatch(data) {
  return request({
    url: `/sys/user/batch`,
    method: 'post',
    data
  })
}

export function updataAssignRoles(data) {
  return request({
    url: '/sys/user/assignRoles',
    method: 'put',
    data
  })
}
